package com.bears.god.sup.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/logout")
public class LogoutServlet extends HttpServlet{

	/**
	 * 退出登录返回到登录页面
	 */
	private static final long serialVersionUID =41L;
	
	@Override
	protected void doGet(HttpServletRequest request,HttpServletResponse response)
		throws ServletException,IOException
		{
			doPost(request,response);
			
		}
	@Override
	protected void doPost(HttpServletRequest request,HttpServletResponse response)
		throws ServletException,IOException
		{
			request.getSession().invalidate();
			
			request.getRequestDispatcher("WEB-INF/view/HomePage.jsp").forward(request, response);			
		}
}